import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';

class ImgBgBox extends HookWidget {
  const ImgBgBox(
      {super.key,
      required this.assetName,
      this.width,
      this.height,
      this.child});
  final double? width;
  final double? height;
  final Widget? child;
  final String assetName;
  @override
  Widget build(BuildContext context) {
    return DecoratedBox(
      decoration: BoxDecoration(
        image: DecorationImage(image: AssetImage(assetName), fit: BoxFit.fill),
      ),
      child: SizedBox(
        width: width,
        height: height,
        child: child,
      ),
    );
  }
}
